package com.police.http;

import java.lang.reflect.Type;

import org.xutils.http.app.ResponseParser;
import org.xutils.http.request.UriRequest;

import android.util.Log;

import com.police.bean.response.MovieBean;
import com.thoughtworks.xstream.XStream;

/** 
 * @ClassName: XmlResponseParser 
 * @Description:  Xml 回复解析器 
 * @author liming
 * @date 2016年6月24日 上午11:28:46 
 *  
 */
public class XmlResponseParser implements ResponseParser
{

	@Override
	public void checkResponse(UriRequest request) throws Throwable
	{
		
	}

	@Override
	public Object parse(Type resultType, Class<?> resultClass, String result)
			throws Throwable
	{
		Log.i("xml:", result);	
		XStream xStream = new XStream();
		xStream.alias("root", resultClass);
		xStream.alias("item", MovieBean.class);
		return xStream.fromXML(result);
	}

}
